Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed LoadSoundAlias() memory leak #3458

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

gk646
Copy link
Contributor

@gk646 gk646 commented Oct 23, 2023

Fixes a memory leak as a result of creating an AudioBuffer* with the old source.frameCount. This internally allocates memory to the structs data pointer which is then later overridden by the correct sound data of the source sound.

Additionally added a volume assignment from old to new as currently there is no way to get the volume of a sound and the AudioBuffer struct is not reachable from user code due to opaque definition. Also it makes sense as an Alias is a new name for the same thing.

…old source.frameCount. This internally allocates memory to the structs data pointer which is then later overridden by the correct sound data of the source sound.

Additionally added a volume assignment from old to new as currently there is no way to get the volume of a sound and the AudioBuffer struct is not reachable from user code due to opaque definition.
@raysan5 raysan5 merged commit daf227a into raysan5:master Oct 23, 2023
@raysan5
Copy link
Owner

raysan5 commented Oct 23, 2023

@gk646 thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants